package com.wasion.pwportable.protocol.analyzer.terminal;

import com.wasion.pwportable.protocol.Result;
import com.wasion.pwportable.protocol.analyzer.AbstractAnalyzer;

public class Terminal_Last_Gather_Analyzer extends AbstractAnalyzer {

	@Override
	public void dataAnalysis(String ackBS) {
		String dataType = ackBS.substring(DATATPYESTARTBIT, DATATPYENDBIT);

		if (dataType.equalsIgnoreCase("DB")) {
			String BS24 = ackBS.substring(DATABITSTART, DATABITSTART + 6);

			if (BS24.equalsIgnoreCase("000001"))
				result.setActionReply(Result.SUCCESS);
			else
				result.setActionReply(Result.FAILED);
		} else
			result.setActionReply(Result.NO_REPLY);
	}
}
